W3CAmaya Doc

Cascading Style Sheet support in Amaya

1st July 1996

This document describes the current state of the Cascading Style Sheet support in Amaya. The implementation is based on the latest (18 Apr 96) CSS1 proposal by Håkon W. Lie and Bert Bos from the W3 Consortium. We focussed on providing as many features as possible and offering an easy to use and learn interface. Considering the second point we choosed a "learn by example" approach suitable for users not experienced with style sheets.

This document contains the following sections:

  1. Section "Presentation" gives a short overview of the CSS.
  2. Section "Interface" details the CSS specific areas of the Amaya interface.
  3. Section "Current State" presents the CSS functionnalities that are currently implemented.
  4. Section "What's lacking" explains the main points to be improved or added.
  5. Section "What's next" is for future plans.

Presentation

CSS defines a syntax to describe presentation associated with elements as a set of properties (like colors, fonts, etc.). Associated to properties, a selector restrict the application of these rules to a set of element depending on their type (like H1, or LI), their context (like an EM in a H3) or classes applied to an element. A set of rules defines which properties should be applied when more than one selector match a given element. While this is relatively simple for someone used to handle structured documents, the experience has shown that a new user may have difficulties to modelize a document as a structured entity. This might be a problem when trying to introduce the CSS to a large audience.

Thus, the challenge is to build a tool simple enough so that inexperienced people can use styles when creating HTML pages with Amaya, while retaining all the possibilities of CSS. The interface was also designed to not hide the underlying complexity of the document structure (Structure View) and of the CSS language (CSS rules may be shown), in order to shorten the learning curve to structured presentation design.

One of the strongest features of CSS is the cascading model. Presentation rules can be fetched from different remote files, tied to the document or associated to one specific element in a page. This allows sharing and reuse of sets of rules whilst allowing specific presentation. It allows also the use of an user defined set of rules to accomodate his preferences. We tried to give a complete and simple view of the cascading model, showing separately specific presentation (Structure View), document specific rules (Structure View and CSS dialog box) and all the set of rules associated to the external files referenced by the document. It is possible to manipulate rules in one file but also to move them from one file to another, allowing a user to take presentation rules from a remote server and apply them selectively to his own pages, in the purpose of building a pool of presentation rules.

User interface

We first present the Style interface as provided by the current version of Amaya:

The Amaya menu bar contains a Style menu containing all the actions related to presentation and style manipulation. Entries in that menu are ordered from the most specific to the most generic operations, except the two last ones, which are not related to CSS, but to HTML (Information type and Character element).

Current State

Here, we focus on what is currently supported from the CSS1 proposal:

There is support for users preferences which can be provided at a site level in Thot/$PLATFORM/amaya.css, or specified by the user in $(HOME)/.amaya.css . Here is an example of an amaya.css file.

The CSS history is stored in $(HOME)/.amaya/history.css and contains the 50 last CSS files loaded by Amaya.

What's lacking

First, considering the current draft compliance, the main issues for full CSS1 support are:

Considering the user interface, one of the main problems style sheet writers will be faced to is the reverse problem induced by the inheritance complexity:

Beginner's question: How do I produce xxx kind of input ?

CSS Writer's question: Why did it produce xxx kind of input ?

Suppose that a part of a document doesn't have the expected look, why ? Considering the underneath complexity of the cascading order, when referencing multiples external CSS, one can easily understand that debugging CSS in real-use might be difficult. One nice feature would be to show graphically all the rules applying to an element or a zone, where they came from, and which rules they superceded.

What's Next

Here is a short list of future actions for CSS in Amaya:


D. Veillard
Webmaster
$Date: 1997/10/23 14:11:52 $